package com.zrs.gmall.payment.controller;

import com.zrs.gmall.common.result.Result;
import com.zrs.gmall.payment.service.PaymentInfoService;
import com.zrs.gmall.payment.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhaoRuiSheng
 * @create 2023/3/14 16:44
 */
@RestController
@RequestMapping("/api/payment")
public class PaymentController {
    @Autowired
    private PaymentService paymentService;

    /**
     * 处理各种支付方式
     * @param orderId
     * @param payType
     * @return
     */
    //TODO 适配器模式
    @GetMapping("/pay")
    public Result pay(Long orderId, String payType) {
        paymentService.pay(orderId, payType);
        return Result.ok();
    }
}


























